<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type"/>
    <title>亿人宝 - 资金记录</title>
    <meta content="" name="keywords"/>
    <meta content="" name="description"/>
    <link rel="stylesheet" th:href="@{/css/common.css}"/>
    <link rel="stylesheet" th:href="@{/css/user.css}" type="text/css"/>
    <script th:src="@{/script/jquery.min.js}" type="text/javascript"></script>
    <script th:src="@{/script/common.js}" type="text/javascript"></script>
    <script th:src="@{/script/user.js}" type="text/javascript"></script>
    <script th:src="@{/layui/layer/layer.js}" type="text/javascript"></script>
    <link rel="stylesheet" th:href="@{/css/fenye.css}"/>
</head>
<body>
<div th:replace="common/public::head"></div>
<!--个人中心-->
<div class="wrapper wbgcolor">
    <div class="w1200 personal">
        <!--<div class="credit-ad"><img height="96" th:src="@{/images/clist1.jpg}" width="1200"></div>-->
        <div class="personal-left" id="personal-left">
            <ul>
                <li><span><a th:href="@{/per/index(option = 1)}"><i class="dot dot1"></i>账户总览</a></span></li>
                <li class="pleft-cur"><span><a style="font-size:14px;text-align:center;width:115px;padding-right:35px;"
                                               th:href="@{/cap/cap_List}">资金记录</a></span></li>
                <li><span><a style="font-size:14px;text-align:center;width:115px;padding-right:35px;" th:href="@{/per/investlist(option = 1)}">投资记录</a></span>
                </li>
                <li><span><a style="font-size:14px;text-align:center;width:115px;padding-right:35px;" th:href="@{/per/prolist}">回款计划</a></span></li>
                <li><span><a th:href="@{/per/thirdparty}"><i class="dot dot02"></i>开通第三方</a> </span></li>
                <li><span><a th:href="@{/per/torecharge}"><i class="dot dot03"></i>充值</a></span></li>
                <li><span><a th:href="@{/per/towithdrawal}"><i class="dot dot04"></i>提现</a></span></li>
                <li style="position:relative;"><span> <a th:href="@{/per/toredenvelopes(state = 1)}"> <i class="dot dot06"></i> 我的红包 </a> </span></li>
                <li style="position:relative;"><span> <a th:href="@{/per/tomessages}"><i class="dot dot08"></i>系统信息 </a> </span></li>
                <li><span><a th:href="@{/setUser/toView}"><i class="dot dot09"></i>账户设置</a></span></li>
            </ul>
        </div>
        <div class="personal-main">
            <div class="personal-money" style="padding-bottom: 0px;">
                <h3><i>资金记录</i></h3>
                <form id="form" method="post" name="form" th:action="@{/cap/cap_List}">
                    <input id="lx" name="lx" type="hidden"/>
                    <div class="money-choose">
                        <span class="money-date1">资金类型</span>
                        <div class="select-date" id="typeboxstyle" style="width: 110px;">
                            <select id="type" name="type" style="height: 25px; width: 110px;border: 1px solid #DCDCDC;border-radius: 2px;color: #BCBCBC;">
                                <option selected="selected" th:selected="${types == ''}" value="">全部</option>
                                <option th:selected="${types == 1}" th:value="1">充值到余额</option>
                                <option th:selected="${types == 2}" th:value="2">余额提现</option>
                                <option th:selected="${types == 3}" th:value="3">购买项目</option>
                                <option th:selected="${types == 4}" th:value="4">本金返回余额</option>
                                <option th:selected="${types == 5}" th:value="5">利息返回余额</option>
                                <option th:selected="${types == 6}" th:value="6">其他资金流动</option>
                            </select>
                        </div>
                        <span class="money-date2">查询时间</span>
                        <div class="select-date" id="select-date" style="width: 110px;">
                            <select id="tradeDate" name="tradeDate"
                                    style="height: 25px; width: 110px;border: 1px solid #DCDCDC;border-radius: 2px;color: #BCBCBC;">
                                <option selected="selected" th:selected="${lx == ''}" value="">全部</option>
                                <option id="today" th:selected="${lx == '今天'}">今天</option>
                                <option id="week" th:selected="${lx == '本周'}">本周</option>
                                <option id="month" th:selected="${lx == '本月'}">本月</option>
                                <option id="halfyear" th:selected="${lx == '半年前'}">半年前</option>
                            </select>
                        </div>
                        <button class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only btn-sx" onclick=" return selcap()" type="submit">
                            <span class="ui-button-text ui-c">筛选</span>
                        </button>
                    </div>
                </form>
                <span id="form:dataTable">
                    <ul class="personal-moneylist">
                        <div class="pmain-contitle">
                            <span class="pmain-title1 fb" style="width: 260px;">交易时间</span>
                            <span class="pmain-title2 fb" style="width: 260px;">交易类型</span>
                            <span class="pmain-title3 fb" style="width: 200px;text-align: left;">交易金额</span>
                            <span class="pmain-title5 fb" style="width: 100px;">备注</span>
                        </div>
                        <ul th:if="${size != 0}">
                            <li style="width: 880px;" th:each="c:${cap.data}">
                                <span class="pmain-title1 pmain-height" style="width: 260px;" th:text="${c.trade_date}">2015-10-20</span>
                                <span class="pmain-title2 pmain-height" style="width: 260px;" th:if="${c.type == 1}">充值到余额</span>
                                <span class="pmain-title2 pmain-height" style="width: 260px;" th:if="${c.type == 2}">余额提现</span>
                                <span class="pmain-title2 pmain-height" style="width: 260px;" th:if="${c.type == 3}">购买项目</span>
                                <span class="pmain-title2 pmain-height" style="width: 260px;" th:if="${c.type == 4}">本金返回余额</span>
                                <span class="pmain-title2 pmain-height" style="width: 260px;" th:if="${c.type == 5}">利息返回余额</span>
                                <span class="pmain-title2 pmain-height" style="width: 260px;" th:if="${c.type == 6}">其他资金流动</span>
                                <span class="pmain-title3 pmain-height" style="width: 200px;text-align: left;" th:text="${c.trade_money}">10.00</span>
                                <span class="pmain-title5 pmain-height" style="width: 100px" th:text="${c.remark}">备注</span>
                            </li>

                            <!--分页显示：-->
                            <div class="pagination" style="margin-top: 15px;">
                                <a th:class="${cap.currPage == 1} ? 'disabled' : ''"
                                   th:href="@{/cap/cap_List(currPage = 1, type = ${types}, tradeDate = ${date}, lx = ${lx})}" title="首页">首页</a>
                                <a th:class="${cap.currPage == 1} ? 'disabled' : ''"
                                   th:href="@{/cap/cap_List(currPage = ${cap.currPage - 1}, type = ${types}, tradeDate = ${date}, lx = ${lx})}"
                                   title="上一页">上一页</a>

                                <a th:if="${cap.totalPage > 4 && cap.currPage > 4}" th:text="...">...</a>
                                <a th:class="${pagenum == cap.currPage} ? 'current' : ''"
                                   th:each="pagenum:${#numbers.sequence((cap.currPage > 4 ? (cap.currPage - 3) : 1), ((cap.currPage + 3) < cap.totalPage ? (cap.currPage + 3): cap.totalPage))}"
                                   th:href="@{/cap/cap_List(currPage = ${pagenum}, type = ${types}, tradeDate = ${date}, lx = ${lx})}"
                                   th:text="${pagenum}">1</a>
                                <a th:if="${cap.totalPage > 4 && (cap.currPage + 3) < cap.totalPage}" th:text="...">...</a>

                                <a th:class="${cap.currPage == cap.totalPage} ? 'disabled' : ''"
                                   th:href="@{/cap/cap_List(currPage = ${cap.currPage + 1}, type = ${types}, tradeDate = ${date}, lx = ${lx})}"
                                   title="下一页">下一页</a>
                                <a th:class="${cap.currPage == cap.totalPage} ? 'disabled' : ''"
                                   th:href="@{/cap/cap_List(currPage = ${cap.totalPage}, type = ${types}, tradeDate = ${date}, lx = ${lx})}" title="尾页">尾页</a>
                            </div>
                        </ul>

                        <div th:if="${size == 0}">
                            <div style=" width:760px;height:200px;padding-top:100px; text-align:center;color:#d4d4d4; font-size:16px;">
                                <img height="60" th:src="@{/images/nondata.png}" width="60">
                                <br><br>
                                暂无资金记录
                            </div>
                        </div>
            </div>
            </span>
        </div>
    </div>
    <div class="clear"></div>
</div>
</div>
<!--网站底部-->
<div class="ft" id="footer">
    <div th:replace="common/public::footer"></div>
</div>
</body>
<script type="text/javascript">

    /* $('.pagination span.num').click(function () {
         if ($(this).text()!='1') {
             $('.one').removeClass('disabled');
             $('.prev').removeClass('disabled');
         } else {
             $('.one').addClass('disabled');
             $('.prev').addClass('disabled');
         }
         $(this).addClass('current').siblings('span.num').removeClass('current');
     });*/

    /**
     * 获取本周、本季度、本月、上月的开端日期、停止日期
     */
    var now = new Date(); //当前日期
    var nowDayOfWeek = now.getDay(); //今天本周的第几天
    var nowDay = now.getDate(); //当前日
    var nowMonth = now.getMonth(); //当前月
    var nowYear = now.getYear(); //当前年
    nowYear += (nowYear < 2000) ? 1900 : 0; //

    var lastMonthDate = new Date(); //上月日期
    lastMonthDate.setDate(1);
    lastMonthDate.setMonth(lastMonthDate.getMonth() - 1);
    var lastYear = lastMonthDate.getYear();
    var lastMonth = lastMonthDate.getMonth();

    //格局化日期：yyyy-MM-dd
    function formatDate(date) {
        var myyear = date.getFullYear();
        var mymonth = date.getMonth() + 1;
        var myweekday = date.getDate();

        if (mymonth < 10) {
            mymonth = "0" + mymonth;
        }
        if (myweekday < 10) {
            myweekday = "0" + myweekday;
        }
        return (myyear + "-" + mymonth + "-" + myweekday);
    }


    function today() {
        var t = new Date();
        var year = t.getFullYear();
        var month = t.getMonth() + 1;
        if (month < 10) {
            month = "0" + month;
        }
        var day = t.getDate();
        if (day < 10) {
            day = "0" + day;
        }
        var showtime = year + "-" + month + "-" + day;
        $('#today').val(showtime);
        return showtime;
    }

    //获得本周的开端日期
    function getWeekStartDate() {
        var weekStartDate = new Date(nowYear, nowMonth, nowDay - nowDayOfWeek + 1);
        var weekstart = formatDate(weekStartDate);
        $('#week').val(weekstart);
        return weekstart;
    }

    //获得本月的开端日期
    function getMonthStartDate() {
        var monthStartDate = new Date(nowYear, nowMonth, 1);
        var monthstart = formatDate(monthStartDate);
        $('#month').val(monthstart);
        return monthstart;
    }

    //半年的日期
    function gethalfyear() {
        var nowDate = new Date();
        var date = new Date(nowDate);
        date.setDate(date.getDate() - 182);
        var seperator1 = "-";
        var year = date.getFullYear();
        var month = date.getMonth() + 1;
        var strDate = date.getDate();
        if (month >= 1 && month <= 9) {
            month = "0" + month;
        }
        if (strDate >= 0 && strDate <= 9) {
            strDate = "0" + strDate;
        }
        var currentdate = year + seperator1 + month + seperator1 + strDate;
        $('#halfyear').val(currentdate);
        return currentdate;

    }

    today();
    getWeekStartDate();
    getMonthStartDate();
    gethalfyear();

    function selcap() {
        var options = $("#tradeDate option:selected").text().trim();  //获取选中的文本内容
        $("#lx").val(options);
        return true;
    }
</script>
</html>
